<template>
  <div>
   <h1 v-text="msg" ref="title"></h1>
   <button @click="showDOM">点击输出上方的dom元素</button>
   <School ref="sch"/>
  </div>
 

</template>

<script>
// 引入school组件
import School from './components/School.vue'
export default {
name:'App',
components:{School},
data() {
  return {
    msg:'欢迎学习vue'
  }
},
methods: {
  showDOM(){
    // vc身上的
    console.log(this.$refs.title)//dom元素
    console.log(this.$refs.sch)//School组件的实例对象(vc)
  }
},
}
</script>

<style>

</style>